#-----------------------------------------------------------------------------
# Name:        PenBackup.py
# Purpose:     
#
# Author:      Luigi Poderico
#
# Created:     2005/04/12
# RCS-ID:      $Id: PenBackup.py $
# Copyright:   (c) 2002
# Licence:     <your licence>
#-----------------------------------------------------------------------------
#!/usr/bin/env python
#Boa:PyApp:main

modules ={'BackUp': [0, '', 'BackUp.py'],
 'Namer': [0, '', 'Namer.py'],
 'SourceBackup': [0, '', 'SourceBackup.py']}

import SourceBackup
import Namer
import BackUp

theSourceBackup = SourceBackup.SourceBackup()
theNamer = Namer.Namer()
theBackUp = BackUp.BackUp()

def main():
    """
    Performes the back-up of an entire file-system sub-tree, generating
    a back-up file name containing the current date.
    The back-up is a zip compatible file.
    """
    
    try:
        __PrintCopyright()
        mySourceBackup = theSourceBackup.GetSourceBackup()
        myNameBackup = theNamer.GetBackupName()
        myDestinationBackup = theNamer.GetDestinationBackup()
        theBackUp.ZipBackup(mySourceBackup, myDestinationBackup, myNameBackup)
    except Exception, myException:
        myMsg = "Errore durante il backup.\n"
        myMsg += str(myException)
        print myMsg
        pass
    
    raw_input("Backup finished. Press enter...")
    
    return

def __PrintCopyright():
    import time
    
    print "PenBackup 1.1"
    print \
    """
    Performes the back-up of an entire file-system sub-tree, generating
    a back-up file, named with the current date.
    The back-up is a zip compatible file.
    """
    print
    print "This is a free software by Poderico Luigi"
    print "www.poderico.it lupoderi@tiscali.it"
    print
    
    time.sleep(7)


if __name__ == '__main__':
    main()
